//调接口
import service from '.'
 
interface loginData{
    username:string,
    password:string
}

//登录接口
export function login(data:loginData){
    return service({
        url:'/user/login',
        method:'post',
        data
    })

   
}
//注册接口
interface registerData{
    username:string,
    password:string,
    confirmPassword:string,
    name:string,
    position:string 
}

export function register(data:Object){
    return service({
        url:'/user/reg',
        method:'post',
        data
    })
}
 
//人员查询接口
export function getPersonList(){
  return service({
      url:"/getPersonList",
      method:"get"
  })
}
 
// 角色列表接口
export function getRoleList(){
    return service({
        url:'/dict/list',
        method:'get'       
    })
 
}
//字典列表接口
export function getDictList(data:Object){
    return service({
        url:'/dict/select_dict',
        method:'post',
        data    
    })
 
}
//获取字典新增数据列表接口
export function getAddList(data:Object){
    return service({
        url:'/dict/add_dict',
        method:'post',
        data
       })
}
// 编辑字典列表接口
export function getEditList(data:Object){
    return service({
        url:'/dict/edit_dict',
        method:'post',
        data
         
    })
}
//字典删除列表接口
export function delList(dictId:number){
    return service({
   
        url:`/dict/delete/${dictId}`,
        method:'get',
        
    })
}

//下拉选项接口
export function getSelList(dictName:string){
    return service({
        url:`/dict/select_byName/${dictName}`,
        method:'get',
     
    })
}



 